package com.xunsiya.common.config.util;

import java.util.HashMap;
import java.util.Map;

/**
 * 公用常量类
 *
 * @author panjun
 * @version 1.0
 *          <p>
 *          <p>修订人		修订时间			描述信息
 *          <p>-----------------------------------------------------
 *          <p>panjun	2018-08-29		初始创建
 */
public class ConstantInfo {

    public static final Integer PLATFORM_COPMANY_ID = -99;

    /**
     * 导出目录
     */
    public static final String EXPORT_PATH = "/export";
    /**
     * 文件后缀
     */
    public static final String EXCEL_SUFFIX = ".xlsx";
    /**
     * 文件后缀
     */
    public static final String EXCEL_SUFFIX_OLD = ".xls";
    /**
     * 指纹后缀
     */
    public static final String SIFT_SUFFIX = ".DB.cdvs";
    /**
     * 分析文本后缀
     */
    public static final String ANALYSIS_TXT_SUFFIX = ".txt";
    /**
     * 识别结果头
     */
    public static final String[] RECOGNIZE_HEAD = {"用户单位名称", "企业名称", "媒体类别", "媒体信息", "链接", "扫描结果", "检测时间"};
    /**
     * 识别结果头
     */
    public static final String RECOGNIZE_NAME = "识别列表";
    /**
     * 非正常退出
     */
    public static final int ERROR_EXIT = -199991;
    /**
     * 超时退出
     */
    public static final int TIMEOUT_EXIT = -199992;
    /**
     * 执行完毕后正常退出
     */
    public static final int NORMAL_EXIT = 0;

    /**
     * 删除标记枚举
     */
    public enum DelType {
        /**
         * 正常
         */
        NORMAL("1"),
        /**
         * 删除
         */
        DELETE("0");

        private String type;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        DelType(String type) {
            this.type = type;
        }
    }

    /**
     * 导入浏览器枚举
     */
    public enum Browser {
        /**
         * IE浏览器
         */
        MSIE("msie"),
        OPERA("opera"),
        SAFARI("safari"),
        MOZILLA("mozilla"),
        APPLEWEBKIT("applewebkit");

        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        Browser(String name) {
            this.name = name;
        }
    }

    /**
     * 算法识别枚举
     */
    public enum RecogType {
        /**
         * 涉政
         */
        FACE("1", "涉政"),
        /**
         * OCR文本
         */
        TEXT("2", "文本"),
        /**
         * 色情
         */
        NUDITY("3", "色情"),
        /**
         * 暴恐
         */
        VIOLENT("4", "暴恐"),
        /**
         * 暴恐 模式
         */
        MODEL_VIOLENT("5", "暴恐");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        RecogType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 文本识别枚举
     */
    public enum RecogTextType {
        /**
         * 色情
         */
        NUDITY("1", "色情"),
        FACE("4", "涉政"),
        FACE_CUSTOMER("5", "涉政"),
        VIOLENT("8", "暴恐"),
        SWINDLE("13", "诈骗"),
        ADVERTISING("14", "广告");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        RecogTextType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 算法识别文件枚举
     */
    public enum FileType {
        /**
         * 图片
         */
        IMAGE("0", "图片"),
        VIDEO("1", "视频"),
        TEXT("2", "文本");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        FileType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * service的服务类型中0为关键词识别
     */
    public final static int SERVICE_TYPE_KEYWORD = 0;

    /**
     * service的服务类型中1为图片识别
     */
    public final static int SERVICE_TYPE_PIC = 1;

    /**
     * 暴恐识别的对象名称
     */
    public final static String VIOLENT_OBJECT = "matchinfos";
    /**
     * 暴恐识别的结果类型
     */
    public final static String VIOLENT_TYPE = "filetype";
    /**
     * 暴恐识别的md5
     */
    public final static String VIOLENT_MD5 = "fileid";
    /**
     * 暴恐识别的分数
     */
    public final static String VIOLENT_SCORE = "matchscore";
    /**
     * 暴恐识别的视频
     */
    public final static String FILE_TYPE = "2";
    /**
     * 暴恐识别的视频
     */
    public final static Integer FP_FILE_TYPE = 1;

    /**
     * 暴恐模式识别分类
     */
    public final static Map<String, String> VIOLENT_MAP = new HashMap<String, String>() {
        {
            put("unknow", "未知");
            put("010001", "客机");
            put("010002", "战斗机");
            put("010003", "直升机");
            put("010004", "运输机 ");
            put("010010", "驱逐舰 ");
            put("010011", "航空母舰");
            put("010012", "潜艇 ");
            put("010020", "坦克");
            put("010021", "装甲车");
            put("010022", "火炮 ");
            put("010023", "大炮_加农炮");
            put("010024", "半履带式机车_半轨 ");
            put("010030", "导弹");
            put("030001", "子弹");
            put("030002", "猎枪 ");
            put("030003", "突击步枪_冲锋枪");
            put("030004", "手枪_左轮手枪");
            put("030005", "步枪_来复枪");
            put("030006", "枪套_手枪皮套");
            put("030007", "防弹背心");
            put("030008", "管制刀具");
            put("030010", "雪山狮子旗");
            put("030011", "星月旗Sherqiy_Türkistan");
            put("030021", "大胡须 ");
            put("030022", "吉里巴甫");
            put("030023", "里切克");
            put("030030", "恐怖分子");
            put("030050", "游行");
            put("030051", "自焚");
            put("030040", "弓");
            put("039001", "枪");
        }
    };

    /**
     * 指纹库类型
     */
    public enum FPType {
        /**
         * 暴恐
         */
        VIOLENT("1", "暴恐"),
        /**
         * 反动
         */
        REACTIONARY("0", "反动");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        FPType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 色情类型
     */
    public enum NudityType {
        /**
         * 色情
         */
        NUDITY("nudity", "色情"),
        /**
         * 性感
         */
        SEXY("sexy", "性感");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        NudityType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }

    /**
     * 媒体类型
     */
    public enum WebsiteType {
        /**
         * 网站
         */
        WEBSITE("2", "网站"),
        /**
         * 性感
         */
        WEIBO("1", "微博"),
        WECHAT("0", "微信");

        private String type;
        private String name;

        public String getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        WebsiteType(String type, String name) {
            this.type = type;
            this.name = name;
        }
    }


    /**
     * 图像类型
     */
    public enum MediaFileType {
        /**
         * 文本
         */
        TXT(0),
        VIDEO(1),
        AUDIO(2),
        MODEL(3);

        private int value;

        private MediaFileType(int value) {
            this.value = value;
        }

        public int getValue() {
            return this.value;
        }

        public void setValue(int value) {
            this.value = value;
        }
    }

    /**
     * 请求错误信息
     */
    public enum HttpCode {
        /**
         * 错误
         */
        HTTP_400("400", "参数错误"),
        HTTP_200("0", "OK"),
        HTTP_600("600", "没有开通该服务，请购买！"),
        HTTP_601("601", "您购买的服务已过期，请重新购买！"),
        HTTP_501("501", "上传文件大小超出限制，最大支持");
        private String value;
        private String desc;

        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        HttpCode(String value, String desc) {
            this.value = value;
            this.desc = desc;
        }
    }

    public enum ProductType {
        //产品类型
        FACE_REC(1, "人脸识别"),
        IMG_REC(2, "图像识别"),
        CODE_REC(3, "二维码识别"),
        TOPMETTING(4, "视频会议");

        private long value;
        private String desc;

        ProductType(long value, String desc) {
            this.value = value;
            this.desc = desc;
        }

        public long getValue() {
            return value;
        }

        public void setValue(long value) {
            this.value = value;
        }

        public String getDesc() {
            return desc;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }
    }
}
